Skip to content

feat: add warning in dev mode when method is not function (#… #8022

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed

feat: add warning in dev mode when method is not function (#… #8022

wants to merge 5 commits into from

Conversation

yaodingyd
Copy link
Contributor

#8017
add warning in dev mode when method is not function

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

If adding a new feature, the PR's description includes:

  • A convincing reason for adding this feature (to avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it)

Other information:

@@ -273,6 +273,11 @@ function initMethods (vm: Component, methods: Object) {
`Avoid defining component methods that start with _ or $.`
)
}
if (typeof methods[key] !== 'function') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you make this test in development mode only and add a test (or/and adapt existing one), please?

@sirlancelot
Copy link

A check and a warning already exists for this in the block directly above the one added by this PR.

@yaodingyd
Copy link
Contributor Author

that's sad.

@yaodingyd yaodingyd closed this Jan 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants